<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>动态绑定外部样式——对象语法</title>
    <style>
        .bg {
            background-color: chocolate;
        }

        .line {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div id="app">
    <h1 class="bg line">Hello, Vue!</h1>
    <!--对象格式：{key1:value1, key2: value2...}-->
    <!--Javascript 对象的简写格式不行-->
    <!--<h1 v-bind:class="{bg , line}">Hello, Vue!</h1>-->
    <!--可以使用 布尔值控制 外部样式 是否生效-->
    <h1 v-bind:class="{bg:true , line:true}">Hello, Vue!</h1>
    <h1 v-bind:class="{bg:false , line:false}">Hello, Vue!</h1>
    <h1 v-bind:class="{bg:isBackGround , line:isLine}">Hello, Vue!</h1>
</div>

<script type="module">
    import {createApp, ref} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                let  isBackGround = ref(true)
                let isLine = ref(true)
                return {
                    isBackGround, isLine
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>